package app.negocio;

import java.util.List;

import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.Query;

import app.entidad.Banco;



public class BancoDAO {

	@Inject
	private EntityManager em;
	
	public void insert(Banco c){
		em.persist(c);
	}
	public Banco read(String id){
		Banco m = em.find(Banco.class, id);
		return m;
	}
public List<Banco> getBanco(){
		
		String sql = "SELECT c From Banco c WHERE c.ban_codigo = :ban_codigo";
		
		Query q =  em.createQuery(sql, Banco.class);
		
		
		List<Banco> lst = q.getResultList();
		
		return lst;
	}

	
}
